<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<title></title>
	<link rel="stylesheet" href="">
	<script type="text/javascript" src="jquery.min.js"></script>
</head>
<body>
	<script type="text/javascript">
		var arr = [{
						days: "2018-11-28",
						id: 166,
						img: "http://modelplus.wx-plus.cn/public/upload/img/20181101/cdb5b0718adc5f96995adae7a728a744.jpg",
						model_id: 2,
						name: "神经病",
						status: 1,
						times: "11:00、12:00",
						user_id: 3
					}, 
					{
						days: "2018-11-28",
						id: 168,
						img: "http://modelplus.wx-plus.cn/public/upload/img/20181101/cdb5b0718adc5f96995adae7a728a744.jpg",
						model_id: 2,
						name: "神经病",
						status: 1,
						times: "9:00、10:00",
						user_id: 3,
					}, 
					{
						days: "2018-12-03",
						id: 161,
						img: "http://modelplus.wx-plus.cn/public/upload/img/20181101/cdb5b0718adc5f96995adae7a728a744.jpg",
						model_id: 2,
						name: "神经病",
						status: 1,
						times: "10:00",
						user_id: 3,
					}, 
					{
						days: "2018-11-23",
						id: 150,
						img: "http://modelplus.wx-plus.cn/public/upload/img/20181101/f27cd3716e375070a335eb8203a8d9ec.png",
						model_id: 11,
						name: "大小兄弟",
						status: 1,
						times: "9:00、10:00、11:00",
						user_id: 3,
					}, 
					{
						days: "2018-11-24",
						id: 149,
						img: "http://modelplus.wx-plus.cn/public/upload/img/20181101/f27cd3716e375070a335eb8203a8d9ec.png",
						model_id: 11,
						name: "大小兄弟",
						status: 1,
						times: "10:00、16:00、21:00",
						user_id: 3,
					}, 
					{
						days: "2018-12-04",
						id: 162,
						img: "http://modelplus.wx-plus.cn/public/upload/img/20181101/f27cd3716e375070a335eb8203a8d9ec.png",
						model_id: 11,
						name: "大小兄弟",
						status: 1,
						times: "9:00",
						user_id: 3,
					}]
		var obj = {};

		// var arr = [1,1,2,3,4,5,6,7,8,8]

		for(var i=0;i<arr.length;i++){
			for(var j=1;j<arr.length;j++){
				
			}
			
		}

		var list=[{id:1,number:2,title:2},{id:1,number:3,title:2}]

		function merge (arr){
		  let result=[ ]
		  let cache={ }
		  arr.forEach(item=>{
		     let key=  {
		     	days: item.days,
				id: item.id,
				img: item.img,
				model_id: item.model_id,
				name: item.name,
				status: item.status,
				times: item.times,
				user_id: item.user_id,
		     }  
		     let index = cache[key]
		      if(index !==undefined){
		         result[index].times +=  item.times + '、'
		      }else{
		         result.push(Object.assign({ }, item))
		         cache[key]=result.length - 1
		       }
		    })
		     return result
		}
		var a = merge(arr)
		console.log('a===>',a)

		// var o = $.extend(true,arr,[])
		// console.log(o)



		// function merge (list){
		//   let result=[ ]
		//   let cache={ }
		//   list.forEach(item=>{
		//      let key=  {id:item.id,title:item.title}  
		//      let index= cache[key]
		//       if(index !==undefined){
		//          result[index].number +=item.number
		//       }else{
		//          result.push(Object.assign({ }, item))
		//          cache[key]=result.length - 1
		//        }
		//     })
		//      return result
		// }

		// var a = merge(list)
		// console.log("a>>>",a)
	</script>
</body>
</html>